{ config, lib, pkgs, ... }:

{
  boot.loader = {
    grub = {
      enable = true;
      default = "saved";
      #configurationName = "NixOS";
      # /dev/sda根据实际盘符修改
      #device = "/dev/sda";
      devices = [ "nodev" ];
      #useOSProber = true;
      efiSupport = true;
      #efiInstallAsRemovable = false;
      extraEntries = ''
        menuentry "Windows" {
         search --file --no-floppy --set=root /EFI/Microsoft/Boot/bootmgfw.efi
         chainloader (''${root})/EFI/Microsoft/Boot/bootmgfw.efi
        }
      '';
    };
  };
}
